package com.lemon.cloud.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lemon.cloud.datascope.annotation.DataColumn;
import com.lemon.cloud.datascope.annotation.DataScope;
import com.lemon.cloud.datascope.enums.ScopeType;
import com.lemon.cloud.admin.dto.UserDTO;
import com.lemon.cloud.comm.po.SysUser;
import org.apache.ibatis.annotations.Param;

public interface SysUserMapper extends BaseMapper<SysUser> {

    SysUser selectByUsername(@Param("username") String username);

    SysUser getByMobile(@Param("mobile") String mobile);

    @DataScope(@DataColumn(alias = "o", name = "id", scopeType = ScopeType.ORG))
    IPage<SysUser> getUserByPage(Page page, @Param("query") UserDTO userDTO);
}
